Goto

Collaborating Authors

 grid and graph


Grids and Graphs

#artificialintelligence

Why do I keep using grids with my pathfinding tutorials? Because they're easy to use, and were incredibly common back when I started working on games. They work with graph-based pathfinding algorithms. I plan to build some demos of non-grid pathfinding graphs too, but grids are easier to explain. I typically use a list of edges per node, but you could also use a global set of edges, or a matrix representation that keeps track of which pairs of nodes have an edge between them.